home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!pmn12564
- From: pmn12564@Bayou.UH.EDU (pat neff)
- Newsgroups: comp.lang.c++
- Subject: Re: Using asm functions as class members!
- Date: 14 Apr 1996 00:32:26 GMT
- Organization: University of Houston
- Message-ID: <4kph2q$h4s@masala.cc.uh.edu>
- References: <4kl6ic$dr6@otis.netspace.net.au>
- NNTP-Posting-Host: bayou.uh.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Bill McIntosh (billmcin@netspace.net.au) wrote:
-
-
- : Ive been having a trouble trying to generate a class with
- : member functions that are assembly routines in external .asm files.
- : I want the assembler function to have access to the specific
- : object's data, but am not having much success.
-
- : ie.
- : class test {
- : int a;
-
- : void asmfunction(); // ???
- : }
- : so, inside the asmfunction() which is actually written TEST.ASM for
- : example, I want it to be able to use 'a' properly as it's object's
- : data.
-
- : Can anyone help me with this? Im currently using a really bad hack
- : of calling a global c function which then calls the asm function and
- : it sucks.
- : I am using watcom 10.5 and wasm but i dont really think this is too
- : relevant seeing as it is a pretty generic problem.
-
- : Thanks!
- : Brett
- : (ps. It would be appreciated if any answers could be mailed becuase
- : I dont get to read news much..)
-
- Welcome to C++! Your hack is probably the only way you are going to
- get this to work. In C++ names get mangled. I have not tried to link an
- external asm function since my 'c' days, but when using inline assembly, any
- variables you want to access must be global, passed, or declared withing the
- function. Granted, this is something of a speed hit most of the time, but I
- do not know of a way to get around it.
-
-